<template>
  <div class="mui-numbox" data-numbox-min="0" style="height:25px">
    <button class="mui-btn mui-numbox-btn-minus" type="button">-</button>
    <input class="mui-numbox-input" type="number" :value="count" ref="num" @change="countChanged">
    <button class="mui-btn mui-numbox-btn-plus" type="button">+</button>
  </div>
</template>
<script>
import mui from "../../lib/mui/js/mui.min.js";

export default {
  props: ["count","goodsid"],
  methods: {
    countChanged() {
    //   console.log(this.$refs.num.value);
      this.$store.commit('updateCount',{
          id:this.goodsid,
          count:this.$refs.num.value
      })
    }
  },
  mounted(){
      mui(".mui-numbox")
        .numbox()
  }
};
</script>
<style lang="scss" scoped>
</style>
